package com.mark.search.controller;

import com.mark.search.config.ElasticSearchOperation;
import com.mark.search.dto.QueryParam;
import com.mark.search.dto.ResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 查询接口
 * </p>
 *
 * @author : mark
 * @since : 2022/7/8 17:37
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class Controller {

    @Resource
    ElasticSearchOperation operation;

    @PostMapping("/query")
    public ResponseVO<Object> query(@RequestBody QueryParam params) {
        return ResponseVO.success(operation.queryOrders(params));
    }
}
